﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace PROJECT_BOMBER.BLL
{
    public class Chronometer
    {

        private double _time = 0;

        private bool _start = false;

        public bool Start
        {
            get { return _start; }
            set { _start = value; }
        }

        

        private int _seconde = 0;

        public int Seconde
        {
            get { return _seconde; }
        }

        public double Time
        {
            get { return _time; }
            set { _time = value; }
        }

        public void Update()
        {
            if (_start)
            {
                _time += Globals.GameTime.ElapsedGameTime.TotalMilliseconds;

                if (_time >= 1000)
                {
                    _seconde++;
                    _time = 0;
                }
            }
        }

        public void Reset()
        {
            _seconde = 0;
        }

    }
}
